package com.atguigu.tingshu.album.job;

import com.atguigu.tingshu.album.service.BloomFilterService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author: atguigu
 * @create: 2024-04-20 09:13
 */
@Slf4j
@Component
public class BloomFilterResizeTask {

    @Autowired
    private BloomFilterService bloomFilterService;

    /**
     * 自动定时任务布隆过滤器检查及扩容
     * 实际：七天执行一次
     */
    @Scheduled(cron = "0 0 3 1/7 * ?")
    public void resizeBloomFilter() {
        bloomFilterService.resizeBloomFilter();
    }
}
